package com.guodefu.demo.mapstruct;

import com.guodefu.demo.domain.DictionaryDO;
import com.guodefu.demo.dto.DictionaryDTO;
import com.guodefu.demo.vo.DictionaryVO;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper(componentModel = "spring")
public interface DictionaryMapStructMapper {

//    @Mapping(source = "type", target = "type") // 手动指定字段映射
//    @Mapping(source = "code", target = "code")
    DictionaryDO toDO(DictionaryDTO dictionaryDTO);
    DictionaryVO toVO(DictionaryDO dictionaryDO);
    List<DictionaryVO> toVOList(List<DictionaryDO> dictionaryDOList);

//    @Mapping(target = "id", ignore = true)
//    void updateDOFromDTO(DictionaryDTO dictionaryDTO, @MappingTarget DictionaryDO dictionaryDO);
}
